package com.yunban.project.api.word_parse;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.alibaba.fastjson2.JSONArray;
import jakarta.annotation.Resource;
import net.lab1024.sa.base.common.annoation.NoNeedLogin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author: lijiajun
 * @date: 2024-11-13
 * @version: 1.0
 */
@RestController
@Tag(name = "word解析")
public class WordParseController {

    @Resource
    private WordParseUtils wordParseUtils;

    @NoNeedLogin
    @Operation(summary = "文件解析")
    @PostMapping("/word-api/parse")
    public JSONArray parseWord(@RequestParam("file") MultipartFile file) {
        return this.wordParseUtils.parse(file);
    }
}